package com.macro.mall.sms.config;

import com.macro.mall.sms.service.SendSmsService;
import com.macro.mall.sms.service.impl.aliyun.AliyunSms;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SmsServiceFactory {
    @Autowired
    private  AliyunSms aliyunSms;

    public  SendSmsService getInstance(BeanConfig beanConfig){
        String smsService = beanConfig.smsService;
        if("aliyun".equals(smsService)){
            return  aliyunSms;
        }
        return null;
    }
}
